package _2ChouXiangGongChang;

import _2ChouXiangGongChang.abst.AbsFactory;
import _2ChouXiangGongChang.abst.BaseFactory;
import _2ChouXiangGongChang.abst.factory.AddFact;


/**
 * @ClientTest: 客户端调用测试
 * @author: ZBoHang
 * @time: 2021/9/1 16:04
 */
class ClientTest {

    public static void main(String[] args) throws Exception {

        // 1 抽象工厂 接口方式
        // Factory addFact = (Factory) Class.forName("_2ChouXiangGongChang.factory.AddFactory").newInstance();
        // System.out.println(addFact.createOperation().getResult(1,2));

        // 2 优化 添加抽象类
        AbsFactory factory = new BaseFactory();

        Operation oper = factory.create(AddFact.class);

        oper.getResult(1, 2);

    }
}
